﻿
package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Benny
	CreateTime:2008-05-19 11:09:58
*/
public class BusMaterialAccountBase extends Table 
{
public static final String TABLE_NAME = "T_BUS_MATERIAL_ACCOUNT";

private static final String BACKUP_TABLE_NAME = "T_BUS_MATERIAL_ACCOUNT_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_BUS_MATERIAL_ACCOUNT_BACKUP";


public static final String ID = "ID";

public static final String WAREHOUSE_CODE = "WAREHOUSE_CODE";

public static final String BUS_TYPE_CODE = "BUS_TYPE_CODE";

public static final String BUS_CATEGORY_CODE = "BUS_CATEGORY_CODE";

public static final String BUS_TAG = "BUS_TAG";

public static final String REPAIREN_TIME = "REPAIREN_TIME";

public static final String REPAIRED_MONEY = "REPAIRED_MONEY";


public static Vector m_fields = null;


private String m_id = ""; //序号

private String m_warehouse_code = ""; //仓库编码

private String m_bus_type_code = ""; //车型编码

private String m_bus_category_code = ""; //车类编码

private String m_bus_tag = ""; //车牌号

private String m_repairen_time = ""; //维修时间

private double m_repaired_money = Value.NULL_DOUBLE; //维修费用



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getWarehouseCode()
	{
	    return m_warehouse_code;
	}
	public void  setWarehouseCode(String v)
	{
		if(getWarehouseCode().equals(v)) return ;
		m_warehouse_code = v ;
		markDirty(WAREHOUSE_CODE);
	}



	

	public String getBusTypeCode()
	{
	    return m_bus_type_code;
	}
	public void  setBusTypeCode(String v)
	{
		if(getBusTypeCode().equals(v)) return ;
		m_bus_type_code = v ;
		markDirty(BUS_TYPE_CODE);
	}



	

	public String getBusCategoryCode()
	{
	    return m_bus_category_code;
	}
	public void  setBusCategoryCode(String v)
	{
		if(getBusCategoryCode().equals(v)) return ;
		m_bus_category_code = v ;
		markDirty(BUS_CATEGORY_CODE);
	}



	

	public String getBusTag()
	{
	    return m_bus_tag;
	}
	public void  setBusTag(String v)
	{
		if(getBusTag().equals(v)) return ;
		m_bus_tag = v ;
		markDirty(BUS_TAG);
	}



	

	public String getRepairenTime()
	{
	    return m_repairen_time;
	}
	public void  setRepairenTime(String v)
	{
		if(getRepairenTime().equals(v)) return ;
		m_repairen_time = v ;
		markDirty(REPAIREN_TIME);
	}



	

	public double getRepairedMoney()
	{
	    return m_repaired_money;
	}
	public void  setRepairedMoney(double v)
	{
		if(getRepairedMoney()==v) return ;
		m_repaired_money = v ;
		markDirty(REPAIRED_MONEY);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseCode(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseCode());
	}

	public String viewBusTypeCode(DBConnection con) throws Exception
	{
		return Value.view(getBusTypeCode());
	}

	public String viewBusCategoryCode(DBConnection con) throws Exception
	{
		return Value.view(getBusCategoryCode());
	}

	public String viewBusTag(DBConnection con) throws Exception
	{
		return Value.view(getBusTag());
	}

	public String viewRepairenTime(DBConnection con) throws Exception
	{
		return Value.view(getRepairenTime());
	}

	public String viewRepairedMoney(DBConnection con) throws Exception
	{
		return Value.view(getRepairedMoney());
	}



protected BusMaterialAccountBase()
{
}

public void fill(BusMaterialAccountPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getWarehouseCode()!=null)
	{	
		setWarehouseCode(pageData.getWarehouseCode());
	}

	if(pageData.getBusTypeCode()!=null)
	{	
		setBusTypeCode(pageData.getBusTypeCode());
	}

	if(pageData.getBusCategoryCode()!=null)
	{	
		setBusCategoryCode(pageData.getBusCategoryCode());
	}

	if(pageData.getBusTag()!=null)
	{	
		setBusTag(pageData.getBusTag());
	}

	if(pageData.getRepairenTime()!=null)
	{	
		setRepairenTime(pageData.getRepairenTime());
	}

	if( pageData.getRepairedMoney()!=null && 
	   !pageData.getRepairedMoney().equals(""))
	{	
		setRepairedMoney(Double.parseDouble(pageData.getRepairedMoney()));
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"序号"));

		m_fields.add(new Field(WAREHOUSE_CODE,Value.TYPE_STRING,false,false,20,"仓库编码"));

		m_fields.add(new Field(BUS_TYPE_CODE,Value.TYPE_STRING,false,false,20,"车型编码"));

		m_fields.add(new Field(BUS_CATEGORY_CODE,Value.TYPE_STRING,false,false,20,"车类编码"));

		m_fields.add(new Field(BUS_TAG,Value.TYPE_STRING,false,false,20,"车牌号"));

		m_fields.add(new Field(REPAIREN_TIME,Value.TYPE_STRING,false,false,20,"维修时间"));

		m_fields.add(new Field(REPAIRED_MONEY,Value.TYPE_DOUBLE,false,false,0,"维修费用"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_warehouse_code = getString(rs,WAREHOUSE_CODE);

	m_bus_type_code = getString(rs,BUS_TYPE_CODE);

	m_bus_category_code = getString(rs,BUS_CATEGORY_CODE);

	m_bus_tag = getString(rs,BUS_TAG);

	m_repairen_time = getString(rs,REPAIREN_TIME);

	m_repaired_money = getDouble(rs,REPAIRED_MONEY);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		return new Value(getWarehouseCode());
	}

	if(f.equalsIgnoreCase(BUS_TYPE_CODE))
	{
		return new Value(getBusTypeCode());
	}

	if(f.equalsIgnoreCase(BUS_CATEGORY_CODE))
	{
		return new Value(getBusCategoryCode());
	}

	if(f.equalsIgnoreCase(BUS_TAG))
	{
		return new Value(getBusTag());
	}

	if(f.equalsIgnoreCase(REPAIREN_TIME))
	{
		return new Value(getRepairenTime());
	}

	if(f.equalsIgnoreCase(REPAIRED_MONEY))
	{
		return new Value(getRepairedMoney());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_CODE))
	{
		setWarehouseCode(v.getString());
	}

	if(f.equalsIgnoreCase(BUS_TYPE_CODE))
	{
		setBusTypeCode(v.getString());
	}

	if(f.equalsIgnoreCase(BUS_CATEGORY_CODE))
	{
		setBusCategoryCode(v.getString());
	}

	if(f.equalsIgnoreCase(BUS_TAG))
	{
		setBusTag(v.getString());
	}

	if(f.equalsIgnoreCase(REPAIREN_TIME))
	{
		setRepairenTime(v.getString());
	}

	if(f.equalsIgnoreCase(REPAIRED_MONEY))
	{
		setRepairedMoney(v.getDouble());
	}
	
}
public String toString()
{
	String msg = "BusMaterialAccount=\n";
	msg += "(\r\n";

	msg += "    序号(id)="+get("id")+"\r\n";

	msg += "    仓库编码(warehouse_code)="+get("warehouse_code")+"\r\n";

	msg += "    车型编码(bus_type_code)="+get("bus_type_code")+"\r\n";

	msg += "    车类编码(bus_category_code)="+get("bus_category_code")+"\r\n";

	msg += "    车牌号(bus_tag)="+get("bus_tag")+"\r\n";

	msg += "    维修时间(repairen_time)="+get("repairen_time")+"\r\n";

	msg += "    维修费用(repaired_money)="+get("repaired_money")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(BusMaterialAccountBase srcObj)
{

	setWarehouseCode(srcObj.getWarehouseCode());

	setBusTypeCode(srcObj.getBusTypeCode());

	setBusCategoryCode(srcObj.getBusCategoryCode());

	setBusTag(srcObj.getBusTag());

	setRepairenTime(srcObj.getRepairenTime());

	setRepairedMoney(srcObj.getRepairedMoney());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<BusMaterialAccount>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<WarehouseCode>"+Value.view(getWarehouseCode())+"</WarehouseCode>";

	xml += "<BusTypeCode>"+Value.view(getBusTypeCode())+"</BusTypeCode>";

	xml += "<BusCategoryCode>"+Value.view(getBusCategoryCode())+"</BusCategoryCode>";

	xml += "<BusTag>"+Value.view(getBusTag())+"</BusTag>";

	xml += "<RepairenTime>"+Value.view(getRepairenTime())+"</RepairenTime>";

	xml += "<RepairedMoney>"+Value.view(getRepairedMoney())+"</RepairedMoney>";
	
	xml += "</BusMaterialAccount>";
	return xml;
}

}
